﻿<UserControl x:Class="bind_n_find.new_ctrl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:props="clr-namespace:bind_n_find.Properties"
    xmlns:bnf="clr-namespace:bind_n_find"
    Height="700" Width="716"
    Loaded="UserControl_Loaded"
            >
    <UserControl.Resources>
        <DataTemplate x:Key="ImageTemplate">
            <StackPanel>
                <CheckBox 
                    x:Name="item_check_box" 
                    IsChecked="{Binding RelativeSource={RelativeSource FindAncestor , AncestorType={x:Type ListViewItem}}, Path=IsSelected}"/>
                    
                <Image Name="item_image" Source="{Binding image}" Width="150" Height="150" /> 
                <TextBlock Name="item_text" Text="{Binding text}" HorizontalAlignment="Center"></TextBlock>
            </StackPanel>
            
        </DataTemplate>
    </UserControl.Resources>

    <Grid Width="716" Height="680">
        <Label Height="27" Foreground="Navy" Margin="12,6,174,0" FontSize="14" Name="label1" VerticalAlignment="Top"  Content="{x:Static props:Resources.New_Ctrl_Caption_Label}" ></Label>
        <Label Height="27" Foreground="Navy" Margin="12,31,242,0" Name="label2" VerticalAlignment="Top" Content="{x:Static props:Resources.New_Ctrl_Document_Name_Label}"></Label>
        <TextBox Height="27" Margin="12,57,214,0" Name="doc_name" VerticalAlignment="Top" />
        <Label Content="{x:Static props:Resources.New_Ctrl_Description_Label}" Foreground="Navy" Height="27" Margin="12,91,242,0" Name="label3" VerticalAlignment="Top" />
        <TextBox Height="99" Margin="12,117,214,0" Name="doc_description" VerticalAlignment="Top" TextWrapping="Wrap" AcceptsReturn="True" />
        <Label Content="{x:Static props:Resources.New_Ctrl_Document_Tags}" Foreground="Navy" Height="27" Margin="12,220,0,0" Name="label4" VerticalAlignment="Top" HorizontalAlignment="Left" Width="206" />
        <Label Content="{x:Static props:Resources.New_Ctrl_Search_Existing_Tags}" Foreground="Navy" Height="27" Margin="289,220,242,0" Name="label5" VerticalAlignment="Top" />
        <ListBox HorizontalAlignment="Left" Margin="12,241,0,323" ItemsSource="{Binding}" Name="doc_tags" Width="206" SelectionMode="Multiple" />
        <ListBox Margin="289,304,214,144" Name="search_tags" ItemsSource="{Binding}" SelectionMode="Multiple" />
        <TextBox Margin="289,241,214,0" Name="search_tabs_textbox" Height="25" VerticalAlignment="Top" TextChanged="search_tabs_textbox_TextChanged" />
        <Button Margin="291,273,344,0" Name="add_tag_button" Content="{x:Static props:Resources.New_Ctrl_Add_Tag_Button}" Height="23" VerticalAlignment="Top" Click="add_tag_button_Click"></Button>
        <Button HorizontalAlignment="Right" Margin="0,273,263,0" Name="delete_tag_button" Width="75" Content="{x:Static props:Resources.New_Ctrl_Delete_Button}" Height="23" VerticalAlignment="Top" Click="delete_tag_button_Click"></Button>
        <Button HorizontalAlignment="Left" Margin="232,304,0,0" Name="toleft_button" Width="43" Content="&lt;" Height="28" VerticalAlignment="Top" Click="toleft_button_Click"></Button>
        <Button HorizontalAlignment="Left" Margin="232,338,0,0" Name="toright_button" Width="43" Content="&gt;" Height="28" VerticalAlignment="Top" Click="toright_button_Click"></Button>
        <Label Height="25" HorizontalAlignment="Left" Margin="12,0,0,294" Name="label6" VerticalAlignment="Bottom" Width="206" Content="{x:Static props:Resources.New_Ctrl_Lang_Label}"></Label>
        <ComboBox ItemsSource="{Binding}" Height="22" HorizontalAlignment="Left" Margin="12,0,0,270" Name="language_combo" VerticalAlignment="Bottom" Width="263" />
        <GroupBox Height="119" HorizontalAlignment="Left" Margin="12,0,0,144" Name="groupBox1" VerticalAlignment="Bottom" Width="263" >
            <GroupBox.Header>
                <CheckBox Content="{x:Static props:Resources.New_Ctrl_Group_Caption}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" Name="check_box1"/>
            </GroupBox.Header>
            <Grid Width="239" Height="88">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="68*" />
                    <ColumnDefinition Width="183*" />
                </Grid.ColumnDefinitions>
                <Label Height="28" Margin="6,14,8,0" Name="label7" VerticalAlignment="Top" Content="{x:Static props:Resources.New_Ctrl_From_Label}"></Label>
                <Label Margin="6,0,8,14" Name="label8" Height="28" VerticalAlignment="Bottom" Content="{x:Static props:Resources.New_Ctrl_To_Label}"></Label>
                <my:DatePicker Grid.Column="1" Height="24" Margin="11,13,22,0" Name="from_date_picker" VerticalAlignment="Top" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" />
                <my:DatePicker Height="24" Margin="11,0,22,18" Name="to_date_picker" VerticalAlignment="Bottom" xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" Grid.Column="1" />
            </Grid>
        </GroupBox>
        <Button Height="22" Margin="0,0,90,83.325" Name="_save_and_close_button" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="102" Content="{x:Static props:Resources.Save_Close_Button}" Click="_save_and_close_button_Click"></Button>
        <ToolBar HorizontalAlignment="Right" Margin="0,57,10,596" Name="toolBar1" Width="195">
            <Button Name="Scanner_Tool_Button" Click="Scanner_Tool_Button_Click">
                <Image Source="Resources\scanner.ico" ToolTip="{x:Static props:Resources.New_Ctrl_ToolBar_Scanner}"/>
            </Button>
            <Button Name="Import_Tool_Button" Click="Import_Tool_Button_Click">
                <Image Source="Resources\import.ico" ToolTip="{x:Static props:Resources.Import_ToolBar}"/>
            </Button>
            <Separator/>
            <Button Name="Up_Tool_Button" Click="Up_Tool_Button_Click">
                <Image Source="Resources\up.ico" ToolTip="{x:Static props:Resources.Up_ToolBar}"/>
            </Button>
            <Button Name="Down_Tool_Button" Click="Down_Tool_Button_Click">
                <Image Source="Resources\down.ico" ToolTip="{x:Static props:Resources.Down_ToolBar}"/>
            </Button>

            <Separator/>
            <Button Name="Remove_Tool_Button" Click="Remove_Tool_Button_Click">
                <Image Source="Resources\remove_file.ico" ToolTip="{x:Static props:Resources.Remove_ToolBar}"/>
            </Button>
        </ToolBar>
        <ListView  HorizontalAlignment="Right" Margin="0,90,16,112" Name="image_view1" Width="176" ItemsSource="{Binding}" ItemTemplate="{StaticResource ImageTemplate}" />
        <Label Height="28" HorizontalAlignment="Right" Margin="0,304,16,0" Name="_loading_label" VerticalAlignment="Top" Width="176" HorizontalContentAlignment="Center" Content="{x:Static props:Resources.Loading_Label1}" Visibility="Hidden"></Label>
    </Grid>
</UserControl>
